﻿
<ValidateForm @ref="UserValidate" Model="Dto" ValidateAllProperties="true" OnValidSubmit="OnValidSubmit">
<div class="row g-3 form-inline">
    <div class="col-12 col-sm-6 col-md-6">
        <BootstrapInput @bind-Value="Dto.Name" />
    </div>
    <div class="col-12 col-sm-6 col-md-6">
        <BootstrapInputNumber @bind-Value="Dto.Age" />
    </div>
    <div class="col-12 col-sm-6 col-md-6">
        <BootstrapInput @bind-Value="Dto.Email" />
    </div>
</div>
</ValidateForm>
@code {
    public UserCreateOrUpdateDto Dto { get; set; } = new();

    public ValidateForm UserValidate;

    Task OnValidSubmit(EditContext context)
    {
        UserValidate.Validate();
        return Task.CompletedTask;
    }
}
